//
//  Location.swift
//  map
//
//  Created by Aoyun on 16/01/2025.
//

import Foundation
import MapKit

// 唯一标识符 Identifiable
// 类型之间的相等性 Equatable ==
struct Location: Identifiable, Equatable {
    let name: String
    let cityName: String
    let coordinates: CLLocationCoordinate2D
    let description: String
    let imageNames: [String]
    let link: String

    var id: String {
        name + cityName
    }

    static func == (lhs: Location, rhs: Location) -> Bool {
        lhs.id == rhs.id
    }
}
